<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      .box {
        height: 300px;
        width: 300px;
        background-color: red;
      }
    </style>
  </head>
  <body>
    <div id="app">
      <button @click="fu1">按钮1</button>
      <button @click="fu4">+1</button>
      <div @mouseenter="fu2" @mouseleave="fu3" class="box">{{connt}}</div>
    </div>
    <script src="./vue.js"></script>
    <script>
      new Vue({
        el: "#app",
        data: {
          connt: 0,
        },
        methods: {
          fu1() {
            alert("点一次300块");
          },
          fu2() {
            alert("进来了");
          },
          fu3() {
            alert("出来了");
          },
          fu4() {
            this.connt++;
          },
        },
      });
    </script>
  </body>
</html>
